Repository navigation
Conversation
|
Can somebody help me with explaining:
|
I think the 2 phpstan issues are connected to each other.
|
|
Thanks, but that's not the error. In PHPUnit, I receive this error, but ONLY in CI: I'm not sure why the assert is a problem, even though the same PHP version (8.2.33) runs successfully in another CI task. And for the Coding Standard check, the error is this: That is not even my code, but Rector's. |
|
I wouldn't worry too much about the rector failure. We probably need to update dependencies there. |
| /** | ||
| * Language string extractor | ||
| */ | ||
| class TwigExtractCommand extends I18nExtractCommand |
There was a problem hiding this comment.
Extending the core command class could make this brittle in the future. We don't provide any backward compatibility promises on protected APIs (which you're using quite a bit here).
What if we had a separate command that only processed twig files, and left the core i18n extract command alone?
There was a problem hiding this comment.
I would not do it. When you have Twig in your project, you can still have PHP files containing translatable strings. So this must be an enhancement to the I18nExtractCommand, not a separate solution.
And using two separate commands (one for Twig and one for all PHP files) will not work, because the second one running won't know about the first's findings.
There was a problem hiding this comment.
Maybe the solution is to update I18nExtractCommand to support additional parsers for different file types; what I did is a step in that direction.
There was a problem hiding this comment.
Yes, ideally the core I18nExtractCommand needs to be made flexible so that it can be configured to use custom parses and storage types.
My use case is that I want to store the message in the database instead of the pot files. I too have extended and overwritten parts of core's I18nExtract to achieve that which isn't very nice https://github.com/ADmad/cakephp-i18n/blob/master/src/Command/I18nExtractCommand.php
|
Hey guys, have you got any updates? We would use this feature too. |
This is an enchantment for Twig-View, for issue #91.
With these changes, users can still use
i18n extract, but it can now parse Twig files and collect all translations from them in the same way the original command does for PHP files.